package com.baicaoyuan.web.repository;


import com.baicaoyuan.web.model.JzzProfitFlowDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 功能描述：
 *
 * @author 罗富祥
 * 创建时间： 2018/1/4
 * 版权：
 */
@Repository
public interface JzzProfitFlowRepository extends JpaRepository<JzzProfitFlowDO, Long> {

    List<JzzProfitFlowDO> findByJzzProfitInputId(Long jzzProfitInputId);

    List<JzzProfitFlowDO> findByUserId(Long userId);

    @Query(value = "select sum(jzz_number), sum(profit) from t_jzz_profit_flow;", nativeQuery = true)
    List getSumJzz();

    Integer countBySerialNumber(String serialNumber);
}
